<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

</body>
<script>
  var timeStart = null;
  var num = 0;
  function startInterval() {
    clearInterval(timeStart);
    timeStart = setInterval(function() {
      num++;
      document.write(num)
      if (num >= 60) {
        clearInterval(timeStart);
      }
    },1000)
  }
  startInterval();
</script>
</html>